package com.k.base.jdk.map;

import java.util.concurrent.ConcurrentHashMap;

public class MapTest {
    public static void main(String[] args) {
        ConcurrentHashMap<String, String> clientMap = new ConcurrentHashMap<>();
        clientMap.put("1","ljw1");
        clientMap.put("2","ljw2");
        // 不存在 key 才放入
        clientMap.putIfAbsent("1","ljw3");
        // 会覆盖原来的 key
        clientMap.put("1","ljw4");
        System.out.println(clientMap);
    }
}
